package qomostudio.com.gridlayouttest;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created by robin on 12/26/15.
 */
public class GalleryItemImageView extends LinearLayout {
    private ImageView imageView;
    private TextView textView;

    public GalleryItemImageView(Context context, AttributeSet attrs) {
        super(context);

        imageView = new ImageView(context, attrs);
        textView = new TextView(context, attrs);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        textView.setGravity(Gravity.CENTER_HORIZONTAL);
        setClickable(true);
        setFocusable(true);
        setOrientation(LinearLayout.VERTICAL);
        addView(imageView);
        addView(textView);
    }
}
